// DrawDoc.h : interface of the CDrawDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_DRAWDOC_H__13DECF53_4AA4_478C_A079_E4F2FC2FD059__INCLUDED_)
#define AFX_DRAWDOC_H__13DECF53_4AA4_478C_A079_E4F2FC2FD059__INCLUDED_

#include "ImageCores/xImage.h"
#include "CAD/CADImage.h"

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CPosition;

class CDrawDoc : public CDocument
{
protected: // create from serialization only
	CDrawDoc();
	DECLARE_DYNCREATE(CDrawDoc)

// Attributes
public:

	CString m_imageType;
	CString m_imageName;
	CString m_pathName;
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDrawDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
	virtual void DeleteContents();
	virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);

	void OnMouseMove(UINT nFlags, const CPosition& pos);
	void OnLButtonDown(UINT nFlags, const CPosition& pos); 
	//}}AFX_VIRTUAL

// Implementation
public:
	inline CDrawView* GetView() { return m_pView; }
	void SetView(CDrawView *view) { m_pView = view; }

	// inline function, get the current dib image
	inline CxImage* GetCxImage() { return this->m_pCxImage; }
	inline CCADImage* GetCADImage() { return this->m_pCADImage; }
	void GetImageType(LPCTSTR lpszPathName, CString &fileType);
	void GetImageName(LPCTSTR lpszPathName, CString &fileName);

	virtual ~CDrawDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	BOOL LoadImage(LPCTSTR lpszPathName);

// Generated message map functions
protected:
	//{{AFX_MSG(CDrawDoc)
	afx_msg void OnEditRedo();
	afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
	afx_msg void OnEditUndo();
	afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
	afx_msg void OnEditCopy();
	afx_msg void OnEditPasteSelection();
	afx_msg void OnUpdateEditPasteSelection(CCmdUI* pCmdUI);
	afx_msg void OnImageMirror();
	afx_msg void OnUpdateImageMirror(CCmdUI* pCmdUI);
	afx_msg void OnImageClearall();
	//}}AFX_MSG
	afx_msg void OnUndoSize(UINT nID);
    afx_msg void OnUpdateUndoSize(CCmdUI* pCmdUI);
	DECLARE_MESSAGE_MAP()
private:
	CxImage *m_pCxImage;
	CCADImage *m_pCADImage;

private:
	CDrawView *m_pView;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DRAWDOC_H__13DECF53_4AA4_478C_A079_E4F2FC2FD059__INCLUDED_)
